AGC circuit, AGC circuit gain control method, and program for the AGC circuit gain control method

ABSTRACT

The present invention relates to an AGC circuit, a AGC circuit gain control method, and a program for the AGC circuit gain control method, and may be applied to IC recorders, for example, as a portable recording/reproducing device, in order to ameliorate problems of listening to talk, music and the like during playback from IC recorders. In the invention, a signal level L 1 cyc is detected in units of the period of an input signal, and a recovery time constant r is switched on the basis of a decision as to the signal level L 1 cyc based on an average shift Lavg of the signal level L 1 cyc.

CROSS REFERENCE TO RELATED APPLICATIONS

The present document is based on Japanese Priority DocumentJP2004-052729, filed to the Japanese Patent Office on Feb. 27, 2004, thecontents of which being incorporated herein by reference.

BACKGROUND OF THE INVENTION

1. Field of the Invention

The present invention relates to an AGC circuit, an AGC circuit gaincontrol method, and a program for the AGC circuit gain control method,and can be applied to an IC recorder which operates as a portablerecording/reproducing device, for example. The present invention isconstructed to detect the level of an input signal in units of theperiod of the input signal, and switch recovery time constants on thebasis of a decision as to the signal level detection result based on theaverage shift of the input signal level, thereby ameliorating problemsof listening to talk, music and the like.

2. Description of Related Art

Various kinds of recording devices have heretofore been constructed tocorrect the signal level of an audio signal by an AGC (Automatic GainControl) circuit. Specifically, when, for example, a talk is recorded bya recording device having an AGC circuit, the voice of a person at anear location is recorded at a large signal level, whereas the voice ofa person at a remote location is recorded at a small signal level. Ifthe recorded signal is reproduced at a sound volume appropriate for thevoice of the person at the near location with neither of these signallevels corrected, the voice of the person at the remote location isreproduced at a low sound volume and becomes impossible to listen to.Conversely, if the recorded signal is reproduced at a sound volumeappropriate for the voice of the person at the remote location, thevoice of the person at a near location is reproduced at an excessivehigh sound volume, so that the voice of the person at the near locationbecomes impossible to listen to. For this reason, in this case, the AGCcircuit corrects the respective voices of the persons at the remote andclose locations into approximately equal signal levels by correcting thesignal level of an audio signal according to the signal level of theaudio signal.

FIG. 18 is a block diagram showing an IC recorder which constitutes oneof these kinds of recording devices. In an IC recorder 1, a microphone 2acquires, during recording, various sounds of a recording target andoutputs an audio signal S1, and an amplification circuit 3, duringrecording, amplifies the audio signal S1 outputted from the microphone 2by a predetermined gain and outputs the amplified audio signal S1. Ananalog-to-digital and digital-to-analog conversion circuit (ADDA) 4,during recording, performs digital/analog conversion of the audio signalS1 outputted from the amplification circuit 3 and outputs the resultantaudio data D1 to a digital signal processor (DSP) 5. During reproduction(playback), the analog-to-digital and digital-to-analog conversioncircuit 4 performs analog/digital conversion of the audio data D1outputted from the digital signal processor 5, and outputs the resultantaudio signal S1 to the second forward/reverse mechanism 6. The secondforward/reverse mechanism 6, during reproduction, amplifies the audiosignal S1 outputted from the analog-to-digital and digital-to-analogconversion circuit 4 by a predetermined gain, and drives a speaker 7 bythis audio signal S1.

The digital signal processor 5, during recording, performs datacompression on the audio data D1 outputted from the analog-to-digitaland digital-to-analog conversion circuit 4 and generates encoded dataD2, and outputs this encoded data D2 to a central processing unit (CPU)8. During reproduction, the digital signal processor 5 performs dataexpansion on the encoded data D2 outputted from the central processingunit 8 and decodes the audio data D1, and outputs the resultant audiodata D1 to the analog-to-digital and digital-to-analog conversioncircuit 4. A memory 9 is made of, for example, a flash memory and,during recording, records and holds the encoded data D2 outputted fromthe digital signal processor 5, under the control of the centralprocessing unit 8. During reproduction, the memory 9 outputs the heldencoded data D2 to the digital signal processor 5 via the centralprocessing unit 8 under the control of the central processing unit 8.The central processing unit 8 is a control circuit which controls theoperation of this IC recorder 1. The central processing unit 8, inresponse to the operation of an operation button 10, instructs eachsection to perform operation such as recording and reproduction.

In this manner, in the IC recorder 1, after the audio signal S1 acquiredby the microphone 2 is amplified with the predetermined gain by theamplification circuit 3, the amplified audio signal S1 is converted intothe audio data D1, and this audio data D1 is compressed and is recordedon the memory 9. During reproduction, in the IC recorder 1, after audiodata decoded from the encoded data D2 recorded on the memory 9 isexpanded by the digital signal processor 5, the audio data is convertedinto the audio signal S1, and the speaker 7 is driven by the audiosignal S1 so as to output reproduced sound.

In this IC recorder 1, an AGC circuit is formed by the digital signalprocessor 5 so that the signal level of the audio data D1 is correctedby the digital signal processor 15 during reproduction in theabove-mentioned audio signal processing sequence.

FIG. 19 is a block diagram showing the construction of the digitalsignal processor 5 which is performing reproduction. In the digitalsignal processor 5, a decoder 12 receives the encoded data D2 held inthe connecting cord 9 from the central processing unit 8 via a buffermemory 13 made of a random access memory, and performs data expansion onthe encoded data D2 and outputs the audio data D1. A variable gainamplification circuit 14 receives the audio data D1 outputted from thedecoder 12 via the buffer memory 15, and amplifies the audio data D1 bya predetermined gain specified by a gain control circuit 16 and outputsthe resultant audio data D1. A buffer memory 17 stores the audio data D1outputted from the variable gain amplification circuit 14 and outputsthe audio data D1 to the analog-to-digital and digital-to-analogconversion circuit 4.

A level detection circuit 18 detects the signal level of the audio dataD1 outputted from the gain control circuit 16, and on the basis of thesignal level detection result by the level detection circuit 18, thegain control circuit 16 sets the gain of the variable gain amplificationcircuit 14 so that the signal level of the audio data D1 detected by thelevel detection circuit 18 becomes a predetermined level. The digitalsignal processor 5 processes the sequentially inputted audio data D1 andencoded data D2 by executing a predetermined processing program, and isconstructed to have various functional blocks associated with theprocessing of the audio data and the encoded data, thereby correctingthe signal level of the audio signal S1 and realizing the function ofthe AGC circuit.

The AGC circuit is constructed to correct and output the signal level ofthe audio data D1 in accordance with the input-output characteristicshown in FIG. 20 by way of example. Namely, if the amplitude value ofthe audio data D1 is within a range of not higher than a predeterminedthreshold Lth, the AGC circuit outputs the inputted audio data D1without suppressing the signal level of the audio data D1, whereas ifthe amplitude value of the audio data D1 exceeds the threshold Lth, theAGC circuit decreases gain and suppresses the signal level of the audiodata D1.

This AGC circuit is constructed to restore the gain suppressed by aso-called recovery time constant into the original gain so as to preventwaveform distortion and the like. However, there is a case where the AGCcircuit produces an audio signal hard of listening to, because of therecovery time constant.

As specifically shown in FIGS. 21A to 21C, if the signal level of aninput signal in, which has, for example, a constant signal level belowthe threshold Lth as a whole, rises as a pulse and exceeds the thresholdLth (FIG. 21A), the AGC circuit decreases gain in response to the pulseof the signal level and gradually restores the decreased gain into theoriginal gain by a recovery time constant tR (FIGS. 21B and 21C).Accordingly, the signal level of an output signal out sharply lowerswith the pulse rise of the signal level and is gradually restored to theoriginal signal level according to the recovery time constant tR, sothat if the recovery time constant tR is relatively long, a long timewill be required until the decreased signal level is restored into theoriginal signal level.

Accordingly, as shown in FIGS. 22A and 22B, if a talk is recorded at aconstant sound volume during clapping (as shown by symbol “CLAP” inFIGS. 22A and 22B), the voice is intermittently suppressed by the risesof the input signal in, and if the recovery time constant tR is long,the duration of this suppression becomes long and breaks in sound occur,so that the voice becomes extremely hard to listen to (FIGS. 22A and22B). Conversely, if the recovery time constant tR is short, breaks insound can be prevented as shown in FIGS. 23A and 23B. However, if therecovery time constant tR is relatively short, the signal level of along resonant sound sharply varies, so that, for example, when music isbeing reproduced, it is perceived as if wow-flatter occurred in the basspart of the music, and crisp-sounding noise is perceived in the treblepart of the music.

For this reason, the AGC circuit is constructed so that when voice is tobe recorded during ordinary conversation, the recovery time constant isset to approximately 10 msec, and when music is to be recorded, therecovery time constant is set to approximately several seconds.

The construction of an AGC circuit capable of switching its recoverytime constant is disclosed in Japanese Laid-Open Patent JP-A-2000-151442and the like.

However, even in the case where the recovery time constant is switchedbetween talk and music in the above-mentioned manner, the problem ofdifficulty to listen to still remains. Namely, during the recording ofvoice, if the recovery time constant is set short, the recorded talkbecomes easy to listen, but its sound volume instantaneously decreasesafter clapping or the like owing to the recovery time constant, with theresult that the recorded talk still remains hard to listen. During therecording of music, if the recovery time constant is set long, therecorded music becomes easy to listen, but its sound volume sharplydecreases after clapping or the like and is gradually restored to theoriginal sound volume, with the result that the recorded music stillremains hard to listen.

SUMMARY OF THE INVENTION

The present invention has been conceived in view of the above-mentionedproblem, and provides an AGC circuit capable of ameliorating problems oflistening to talk, music and the like, an AGC circuit gain controlmethod, and a program for the AGC circuit gain control method.

To alleviate the above-mentioned problems, according to a preferredembodiment of the present invention, there is provided an AGC circuitwhich varies gain according to a signal level of an input signal andcorrects the signal level of the input signal. The AGC circuit includessignal level detection means for detecting the signal level of the inputsignal in units of the period of the input signal and outputting asignal level detection result, and gain varying means for providingvariable control of gain for each period corresponding to the signallevel detection result on the basis of the signal level detectionresult. The gain varying means, gradually restores the decreased gaininto gain corresponding to the signal level detection result by arecovery time constant in response to the fall of the signal level ofthe input signal, after decreasing the gain in response to the rise ofthe signal level of the input signal, and switches the recovery timeconstant on the basis of a decision as to the signal level detectionresult based on a average shift of the signal level of the input signal.

According to another preferred embodiment of the present invention,there is provided a gain control method for an AGC circuit which variesgain according to a signal level of an input signal and corrects thesignal level of the input signal. The gain control method includes asignal level detection step of detecting the signal level of the inputsignal in units of the period of the input signal and outputting asignal level detection result, and a gain varying step of providingvariable control of gain for each period corresponding to the signallevel detection result on the basis of the signal level detectionresult. The gain varying step gradually restores the decreased gain intogain corresponding to the signal level detection result by a recoverytime constant in response to the fall of the signal level of the inputsignal, after decreasing the gain in response to the rise of the signallevel of the input signal, and switches the recovery time constant onthe basis of a decision as to the signal level detection result based ona average shift of the signal level of the input signal.

According to another preferred embodiment of the present invention,there is provided a program of a gain control method for an AGC circuitwhich varies gain according to a signal level of an input signal andcorrects the signal level of the input signal, by causing arithmeticprocessing means to execute a predetermined processing sequence. Theprocessing sequence includes a signal level detection step of detectingthe signal level of the input signal in units of the period of the inputsignal and outputting a signal level detection result, and a gainvarying step of providing variable control of gain for each periodcorresponding to the signal level detection result on the basis of thesignal level detection result. The gain varying step may graduallyrestore the decreased gain into gain corresponding to the signal leveldetection result on the basis of a recovery time constant in response tothe fall of the signal level of the input signal, after decreasing thegain in response to the rise of the signal level of the input signal,and switch the recovery time constant on the basis of a decision as tothe signal level detection result based on an average shift of thesignal level of the input signal.

In the AGC circuit according the preferred embodiment of the presentinvention, the average shift value is an approximate value calculated byweighting addition based on a previously calculated average shift valueand the result of signal level detection.

A preferred embodiment of the present invention may be provided with theAGC circuit for varying gain according to the signal level of the inputsignal and correcting the signal level of the input signal. The AGCcircuit may include the signal level detection means for detecting thesignal level of the input signal in units of the period of the inputsignal and outputting the signal level detection result, and the gainvarying means for providing variable control of gain for each periodcorresponding to the signal level detection result on the basis of thesignal level detection result. The gain varying means may graduallyrestore the decreased gain into gain corresponding to the signal leveldetection result by a recovery time constant in response to the fall ofthe signal level of the input signal, after decreasing the gain inresponse to the rise of the signal level of the input signal, and switchthe recovery time constant on the basis of the decision as to the signallevel detection result based on the average shift of the signal level ofthe input signal. Accordingly, if the signal level rises almostinstantaneously, for example, the recovery time constant can be setshort so as to follow the fall of the signal level after the rise of thesignal level, and if the signal level rises as a whole, the recoverytime constant can be set long, whereby it is possible to switch therecovery time constant according to the transition of the signal levelof the input signal. Accordingly, it is possible to ameliorate problemsof listening to talk, music or the like, by preventing the signal levelfrom being unnecessarily suppressed by the recovery time constant and bysuppressing the signal level by the recovery time constant as occasiondemands.

According to the preferred embodiments of the present invention, an AGCcircuit may be provided, capable of ameliorating problems of listeningto talk, music and the like, an AGC circuit gain control method, and aprogram for the AGC circuit gain control method.

According to the preferred embodiments of present invention, it ispossible to ameliorate problems of listening to talk, music and thelike. The present invention can be applied to, for example, ICrecorders.

BRIEF DESCRIPTION OF THE DRAWINGS

The above and other objects, features and advantages of the presentinvention will become more apparent from the following description ofthe presently preferred exemplary embodiments of the invention taken inconjunction with the accompanying drawings, in which:

FIG. 1 is a flowchart showing a processing sequence of a digital signalprocessor in an IC recorder according to a preferred embodiment of thepresent invention;

FIG. 2 is a block diagram showing the IC recorder according to thepreferred embodiment of the present invention;

FIG. 3 is a characteristic curve diagram showing the input-outputcharacteristic of an AGC circuit in the processing of FIG. 1;

FIGS. 4A and 4B are time charts aiding in describing the processing ofFIG. 1;

FIG. 5 is a flowchart showing a continuation of the process of FIG. 1;

FIG. 6 is a time chart aiding in describing moving average according tothe processing of FIG. 1;

FIGS. 7A and 7B are schematic views aiding in describing recovery timeconstants;

FIG. 8 is a time chart aiding in describing a variable Lrecv which isused in the processing sequence of FIG. 1;

FIG. 9 is a characteristic curve diagram aiding in describing thesetting of gain for a small signal level;

FIG. 10 is a time chart aiding in describing an example of amonotonously increasing signal level;

FIG. 11 is a characteristic curve diagram aiding in describing thesetting of gain in the example of FIG. 10;

FIG. 12 is a time chart aiding in describing the updating of thevariable Lrecv;

FIG. 13 is a time chart showing the case where the fall of the signallevel is large;

FIG. 14 is a time chart showing the case where the fall of the signallevel is small;

FIG. 15 is a time chart showing the relationship between signal levelsover individual periods and the average value of the signal levels;

FIGS. 16A and 16B are schematic views showing the relationship betweenthe relationship of FIG. 15 and the recovery time constants;

FIG. 17 is a signal waveform diagram showing the manner of reproductionof audio data;

FIG. 18 is a block diagram showing a conventional IC recorder;

FIG. 19 is a functional block diagram showing a digital signal processorwhich is performing reproduction in the IC recorder of FIG. 18;

FIG. 20 is a characteristic curve diagram showing an input-outputcharacteristic of an AGC circuit of FIG. 19;

FIGS. 21A, 21B and 21C are signal waveform diagrams aiding in describingvariations in a signal level due to a recovery time constant;

FIGS. 22A and 22B are signal waveform diagrams aiding in describing avariation in a signal level due to a long recovery time constant; and

FIGS. 23A and 23B are signal waveform diagrams aiding in describing avariation in a signal level due to a short recovery time constant.

DESCRIPTION OF THE PREFERRED EMBODIMENTS

Preferred embodiments of the present invention will be described belowin detail with reference to the accompanying drawings.

FIRST EXAMPLE OF THE PREFERRED EMBODIMENT

(1) Construction of the First Example of Preferred Embodiment

FIG. 2 is a block diagram showing an IC recorder according to a firstpreferred embodiment of the present invention. In an IC recorder 11, amicrophone 12, during recording, acquires various sounds of a recordingtarget and outputs an audio signal S1, and an analog digital conversioncircuit (AD) 14, during recording, performs digital/analog conversion ofthe audio signal S1 and outputs resultant audio data D1 to a digitalsignal processor (DSP) 15.

The digital signal processor 15, during recording, performs datacompression on the audio data D1 outputted from the analog digitalconversion circuit 14 and generates encoded data D2, and outputs thisencoded data D2 to a central processing unit (CPU) 18. Duringreproduction, the digital signal processor 15 performs data expansion onthe encoded data D2 outputted from the central processing unit 18 anddecodes the audio data D1, and corrects the signal level of this audiodata D1 and outputs the resultant audio data D1 to a digital/analogconversion circuit (DA) 17. A memory 19 is made of, for example, amemory card using a flash memory and, during recording, records andholds the encoded data D2 outputted from the digital signal processor15, under the control of the central processing unit 18. Duringreproduction, the memory 19 outputs the held encoded data D2 to thedigital signal processor 15 via the central processing unit 18 under thecontrol of the central processing unit 18. The central processing unit18 is a control circuit which controls the operation of this IC recorder1. The central processing unit 18, in response to the operation of anoperation button 20, instructs each section to perform operation such asrecording and reproduction, and displays various operation menus via adisplay section 21 using a liquid crystal display panel.

The digital/analog conversion circuit 17, during reproduction, performsdigital/analog conversion of the audio data D1 outputted from thedigital signal processor 15, and drives a speaker 22 by means of theresultant audio signal S1.

In this manner, in the IC recorder 11, after the audio signal S1acquired by the microphone 12 is converted into the audio data D1, thisaudio data D1 is compressed and is recorded on the memory 19. Duringreproduction, in the IC recorder 11, after the audio data D1 decodedfrom the encoded data D2 recorded on the memory 19 is expanded by thedigital signal processor 15, the audio data D1 is converted into theaudio signal S1, and the speaker 22 is driven by the audio signal so asto output reproduced sound.

In this IC recorder 11, an AGC circuit is formed by the digital signalprocessor 15 so that the signal level of the audio data D1 is correctedby the digital signal processor 15 during reproduction in theabove-mentioned audio signal processing sequence.

Namely, the digital signal processor 15 includes a random access memory(RAM) 15A via which the digital signal processor 15 communicates theaudio data D1 and the encoded data D2 with the analog digital conversioncircuit 14, the central processing unit 18 and the digital/analogconversion circuit 17, and a digital signal processor core 15B which isarithmetic processing means and executes a predetermined processingprogram to process these audio data D1 and encoded data D2. The digitalsignal processor core 15B is constructed to have functional blocks whichare an encoder BA for performing data compression on the audio data D1and generating the encoded data D2, a decoder 15BB for performing dataexpansion on the encoded data D2 and decoding the audio data D1, and anAGC circuit 15BC for correcting the signal level of the audio data D1.The processing program is provided by prior installation, but may alsobe provided by downloading via a network or by a recording medium.Various recording media such as memory cards, magnetic discs and opticaldiscs can be applied to the recording medium.

The digital signal processor 15 is constructed to correct, in processingassociated with the AGC circuit 15BC, the signal level of the audio dataD1 by using a gain coefficient of an AGC coefficient conversion table15C provided in an internal random access memory built in the AGCcircuit 15BC. The AGC coefficient conversion table 15C is constructed sothat gain by which to correct the signal level of the audio data D1 isrecorded on the AGC coefficient conversion table 15C in accordance withthe input level of the AGC circuit 15BC. In the first preferredembodiment, this gain is defined by the input-output characteristicshown in FIG. 3. Namely, within the range of this input-outputcharacteristic in which the input level is not lower than apredetermined threshold Lth, the output level is made to rise inproportion to the input level so that the gain based on this proportionis set to a gain of 1. Within the range in which the input level exceedsthe threshold Lth, the gain is made gradually lower with an increase inthe input level so that the output level is held at the threshold Lth.

FIGS. 1 and 5 are flowcharts showing the processing sequence of the AGCcircuit 15BC of this digital signal processor 15. When a user operatesthe operation button 20 to instruct the IC recorder 11 to reproduce theencoded data D2 recorded on the memory 19, the digital signal processor15, under the control of the central processing unit 18, starts aprocessing sequence associated with the decoder 15BB and the processingsequence shown in FIG. 1, and executes these processing sequences in asimultaneous and parallel manner.

Namely, when the digital signal processor 15 starts the processingsequence shown in FIG. 1, the digital signal processor 15 proceeds fromstep SP1 to step SP2 and initializes a set of variables to be used inthis processing. As shown in FIGS. 4A and 4B, the digital signalprocessor 15 is constructed to set the period from which the signalwaveform of the audio data D1 crosses zero (crosses 0) and rises untilthe signal waveform again crosses zero and rises, to one period of theaudio data D1, and process the audio data D1 in units of this period. Inthe set of variables, a variable i is a variable which specifies theperiod of audio data associated with a target to be processed, from thestarting time of the processing. In the initializing processing of stepSP2, the variable 1 is set to a value of 0.

A variable kxa is a multiplication value to be used for updating avariable Lrecv which will be described later. In step SP2, the variablekxa is initialized to a value of 1. A variable r is a variable whichspecifies a recovery time constant, and in the first preferredembodiment, two recovery time constants, i.e., a recovery time constantrFast indicative of short time and a recovery time constant rSlowindicative of long time, are prepared. In step SP2, the variable r isinitialized to specify the recovery time constant rSLow indicative ofshort time. The recovery time constant rFast and the recovery timeconstant rSlow are respectively assigned several 10 msec and severalmsec.

A variable Lavg is a variable indicating the average value of the signallevel of the audio data D1. As shown in FIG. 6, the digital signalprocessor 15 calculates the average shift Lavg of the signal level ofthe audio data D1 over a predetermined number of successive periods ofthe audio data D1 containing the period specified by the variable i, anddetermines the rise of a signal level L1cyc(i) over the period specifiedby the variable i, on the basis of the average shift Lavg, and switchesthe recovery time constant r. Through this initializing processing, theaverage shift Lavg is initialized to 0. In addition, the average shiftLavg may be calculated over a predetermined number of periods whichinclude the central period, i.e., the period specified by the variablei, and the periods preceding and succeeding the central period, or theaverage shift Lavg may also be calculated over a predetermined number ofperiods which include the period specified by the variable i, as thestart period or the end period. If the average shift Lavg is calculatedover a predetermined number of periods whose end period is the periodspecified by the variable i, the periods do not include a periodassociated with the succeeding processing, so that the sampling numberof the audio data D1 during reading-ahead can be eliminated to simplifythe processing. Conversely, if the average shift Lavg is calculated overa predetermined number of periods whose start period is the periodspecified by the variable i, the sampling number of the audio data D1during reading-ahead increases and the processing becomes complicated,but the variation of the signal level of the audio data D1 after thatstart period can be accurately predicted, whereby the control of gain inthe AGC circuit 15BC can be executed far more appropriately. Inaddition, in the first preferred embodiment of the present invention,the processing is simplified by calculating the average shift Lavg overa predetermined number of periods whose end period is the periodspecified by the variable i.

The variable Lrecv is assigned a signal level determined by the recoverytime constant r over one period specified by the variable i. Morespecifically, as shown in FIGS. 7A and 7B which respectively show thecases where the recovery time constant is short (rFast) and where therecovery time constant is long (rSlow), the initial value of the signallevel due to this attenuation characteristic is assigned to the variableLrecv on condition that the signal level L1cyc(i) for the periodspecified by the variable i exhibits an attenuation characteristic dueto the recovery time constant r as shown in FIGS. 7A and 7B. In thefirst preferred embodiment, it is assumed that the signal level based onthis attenuation characteristic linearly lowers, and the attenuationcharacteristic is represented by approximation using a linear functionso that the processing is simplified by an amount corresponding to theapproximation. The variable Lrecv is set to a value of 0 by thisinitializing processing.

After having initialized each of the variables in the above-mentionedmanner, the digital signal processor 15 proceeds to step SP3 and detectsthe signal level L1cyc(i) of the audio data D1 over the period specifiedby the variable i (FIG. 4B). In the first preferred embodiment, amaximum amplitude value in the period specified by the variable i isassigned to the signal level L1cyc(i), whereby the arithmetic throughputcan be reduced to simplify the processing. In other words, variousreference values which vary according to a maximum amplitude value inone period of the audio data D1 can be applied to the signal levelL1cyc(i) in this one period, and for example, the sum of the squares ofindividual sampled values over one period of the audio data D1, the sumof the absolute values of the individual sampled values, the averagevalue of the individual sampled values, or the absolute value of a peakvalue can be applied to the signal level L1cyc(i). In addition, avariable istart(i) and a variable iend(i) respectively indicate thestart time and the end time of the period specified by the variable i.

After having detected the signal level L1cyc(i) of the audio data D1 inthe above-mentioned manner, the digital signal processor 15 proceeds tostep SP4 and determines whether the signal level based on the variableLrecv exceeds the threshold Lth. If the digital signal processor 15obtains a negative result, the digital signal processor 15 proceeds tostep SP5.

Here, the digital signal processor 15 calculates the average shift Lavgover the period specified by the variable i. The digital signalprocessor 15 is constructed to calculate the average shift Lavg of thesignal level over a predetermined number of periods whose end period isthe period specified by the variable i, and calculates the average shiftLavg by an approximate calculation using the weighted sum of the so farcalculated average shift Lavg weighted by a weighting coefficient of 0.9and the signal level L1cyc(i) calculated in step SP3 and weighted by aweighting coefficient of 0.1, thereby simplifying the processing by anamount corresponding to the approximate calculation. In other words, inthis calculation of the average shift Lavg, various reference valueswhich indicate the average signal level of the audio data D1 over aplurality of successive periods including the period specified by thevariable i can be applied to the average shift Lavg, and for example,the sum of the squares of individual sampled values of the audio data D1over these periods, the sum of the absolute values of the individualsampled values, the average value of the individual sampled values, orthe absolute value of the amplitude values of the audio data D1 can beapplied to the average shift Lavg.

Then, the digital signal processor 15 proceeds to step SP6 anddetermines whether the signal level L1cyc(i) of the audio data D1 overthe period specified by the variable i calculated in step SP3 exceedsthe signal level based on the variable Lrecv subjected to the processingof step SP4. In this case, since the initial value of the variable Lrecvis set to a value of 0, the digital signal processor 15 obtains anaffirmative answer, and proceeds from step SP5 to step SP7 and againinitializes the variable Lrecv by the recovery time constant r. Thisinitializing processing of step SP7 is executed in such a manner thatthe signal level L1cyc(i) over the period specified by the variable i isset to the signal level based on the variable Lrecv as shown by a suffix“new” in FIG. 8. The digital signal processor 15 also sets the gain kxof the AGC circuit 15BC to a gain of 1.

In the next step SP8, the digital signal processor 15 divides the signallevel L1cyc(i) calculated in step SP3 by the average shift Lavgcalculated in step SP5 and makes a decision using a predeterminedthreshold Ratio0, thereby determining whether the signal level based onthe period specified by the variable i is sharply raising. If the signallevel of the audio data D1 remains at an approximately constant signallevel, the digital signal processor 15 obtains a negative result in stepSP8, and proceeds from step SP8 to step SP9. In step SP9, the digitalsignal processor 15 sets the recovery time constant r to the recoverytime constant rSlow indicative of long time.

In the next step SP10, the digital signal processor 15 determineswhether the signal level based on the variable Lrecv is not higher thanthe threshold Lth. If the digital signal processor 15 obtains anaffirmative result, the digital signal processor 15 proceeds from stepSP10 to step SP11 and accesses the AGC coefficient conversion table 15Con the basis of the signal level L1cyc(i) of the audio data D1 over theperiod specified by the variable i calculated in step SP3, and sets again G(L1cyc(i)) corresponding to this signal level L1cyc(i) to a gainkx.

In the next step SP12, the digital signal processor 15 corrects by thisgain kx a signal level din(k) of the audio data D1 over one periodspecified by the variable i, and executes AGC processing of the audiodata D1 over this one period. In the next step SP13, the digital signalprocessor 15 increments the variable i and switches the target to beprocessed to the succeeding one period. After that, the digital signalprocessor 15 returns to step SP3 and starts to process the succeedingone period.

Accordingly, in the case where the signal level of the audio data D1keeps monotonously increasing at not higher than the threshold Lth ineach of successive periods like periods i−5 to i−3, i−2 to i and i+2 toi+4 in FIG. 8, the digital signal processor 15 repeats the processingsequence of steps SP3-SP4-SP5-SP6-SP7-SP8-SP9-SP10-SP11-SP12-SP13-SP3for each of the successive periods, and sequentially multiplies each ofthe sampled values of the audio data D1 by a value of 1 while updatingthe variable Lrecv associated with the attenuation curve, therebyoutputting the audio data D1 at an output level proportional to theinput level, as shown in FIG. 9.

In addition, in the case where the signal level of the audio data D1over each of the successive periods is not higher than the threshold Lthand the signal level over a period such as any of the periods i−2, i+1and i+2 shown FIG. 8 falls compared to the immediately previous period,the digital signal processor 15 obtains a negative result in step SP6 inthe processing sequence of stepsSP3-SP4-SP5-SP6-SP7-SP8-SP9-SP10-SP11-SP12-SP13-SP3. Accordingly, thedigital signal processor 15 proceeds from step SP6 directly to step SP10without executing the updating processing of the variable Lrecv ormaking a decision as to the rise of the signal level over the periodspecified by the variable i.

Accordingly, in the case where the signal level L1cyc(i) is not higherthan the threshold Lth and the signal level L1cyc(i) rises compares tothe immediately previous period, the digital signal processor 15 outputsthe audio data D1 at the input level by executing the processingsequence of steps SP3-SP4-SP5-SP6-SP7-SP8-SP9-SP10-SP11-SP12-SP13-SP3.

In this case as well, the digital signal processor 15 outputs the audiodata D1 with an input-output characteristic having a proportionalrelationship to the input level as shown in FIG. 8.

Conversely, while the digital signal processor 15 is repeating theprocessing of the audio data D1 having a signal level of not higher thanthe threshold Lth, if the digital signal processor 15 receives a periodcontaining the signal level L1cyc(i) which exceeds the threshold Lth asshown in FIG. 10, the digital signal processor 15 sets the signal levelL1cyc(i) exceeding the threshold Lth to the variable Lrecv in thisrepetitive processing of step SP7, and obtains a negative result in stepSP10. In this case, the digital signal processor 15 proceeds from stepSP10 to step SP15, and accesses the AGC coefficient conversion table 15Con the basis of the signal level L1cyc(i) over the period specified bythe variable i, and sets a gain G(Lrecv) based on the signal levelL1cyc(i) to the gain kx. Then, in the next step SP12, the digital signalprocessor 15 corrects the signal level of the audio data D1 over thisperiod i by the gain kx, and then returns from step SP13 to step SP3.

Accordingly, in this case, as shown in FIG. 11, the digital signalprocessor 15 corrects the signal level of the audio data D1 on the basisof the saturation range of the input-output characteristic, and outputsthe result.

In the case where the signal level L1cyc(i) exceeding the threshold Lthis set to the variable Lrecv in the above-mentioned manner, the digitalsignal processor 15 returns to step SP3, and in the next step SP4,obtains an affirmative result because the signal level based on thevariable Lrecv (over the period specified by the variable i+1) exceedsthe threshold Lth. The digital signal processor 15 proceeds to stepSP16.

In step SP16, the digital signal processor 15 updates the variable Lrecvby the attenuation characteristic specified by the recovery timeconstant r. In this case, the digital signal processor 15 assumes anattenuation characteristic of a signal level which linearly variesaccording to the inclination specified by the recovery time constant r,on the basis of the multiplication value kxa to be used for the updatingof the variable Lrecv, and calculates the variable kxa at the end timeiend(i) of the period specified by the variable i in accordance with theattenuation characteristic, which period is started on the basis of thevariable kxa. The digital signal processor 15 also multiplies thevariable Lrecv by the calculated multiplication value kxa, andcalculates a signal level Lrecv(new) obtainable at the end time iend(i)of the period i over which the signal level based on the variable Lrecvis attenuated by the attenuation characteristic specified by therecovery time constant r as shown in FIG. 12.

The digital signal processor 15 updates the variable Lrecv in thismanner, and proceeds to step SP5. The digital signal processor 15calculates the average shift Lavg in step SP5, and proceeds to step SP6.In step SP6, if the signal level of the audio data D1 over the period iassociated with the processing of updating the variable Lrecv is notlower than the signal level based on the updated variable Lrecv, thedigital signal processor 15 proceeds from step SP6 to step SP7 and againupdates the variable Lrecv updated in this manner (as shown byLrecv(new2) in FIG. 12), and resets the variable kxa to the originalvalue of 1. Then, the digital signal processor 15 proceeds to step SP8.

Accordingly, as shown in FIG. 10, over the periods of the variables i toi+5, the digital signal processor 15 suppresses the signal level of theaudio data D1 to the signal at the threshold Lth and outputs theresultant audio data D1, while again updating in step SP7 the variableLrecv updated in step SP16, by repeating the processing sequence ofsteps SP3-SP4-SP16-SP5-SP6-SP7-SP8-SP9-SP10-SP11-SP12-SP13-SP3.

In the case where, as shown in FIG. 13, the signal level L1cyc(i)increases above the threshold Lth and then falls and the signal levelbased on the variable Lrecv associated with the attenuation curve of therecovery time constant r is higher than the signal level L1cyc over eachof the periods, the digital signal processor 15 obtains a negativeresult in step SP6, and proceeds to step SP10 without again updating instep SP7 the variable Lrecv updated in step SP16. In step SP10, thedigital signal processor 15 sequentially updates the variable Lrecv onthe basis of the signal level at the end time of each of the periods inaccordance with the attenuation curve of the recovery time constant r.Then, in step SP15, the digital signal processor 15 selects the gain kxcorresponding to the signal level based on the variable Lrecv from theAGC coefficient conversion table 15C, and corrects the gain of the audiodata D1 by the gain kx.

In the case where, as shown in FIG. 14, the signal level L1cyc increasesabove the threshold Lth and then falls and the signal level based on thevariable Lrecv associated with the attenuation curve of the recoverytime constant r is smaller than the signal level L1cyc over each of theperiods (in the case of the period i+1), the digital signal processor 15obtains an affirmative result in step SP6 and again updates the variableLrecv updated in step SP16, whereby the digital signal processor 15suppresses the signal level over the period i+1 by the gaincorresponding to the signal level L1cyc of the audio data D1 over thesame period and outputs the resultant audio data D1.

Accordingly, in the first preferred embodiment, only in the case whereafter the signal level L1cyc of the audio data D1 has risen above thethreshold Lth, the signal level L1cyc lowers more sharply than theattenuation characteristic specified by the recovery time constant r,the digital signal processor 15 corrects the signal level of the audiodata D1 by the gain specified by the recovery time constant r, insteadof by the gain corresponding to the signal level L1cyc of the audio dataD1. In addition, in this case, the digital signal processor 15 correctsthe signal level of the audio data D1 by the gain corresponding to anexcessively large signal level compared to the signal level L1cyc of theaudio data D1, whereby it is possible to predict the occurrence of abreak in sound and the like.

Accordingly, in the first preferred embodiment, in the case where theoccurrence of a break in sound and the like can be predicted and thesignal level L1cyc of the audio data D1 instantaneously increases, avalue obtained by dividing the signal level L1cyc associated with theprocessing sequence of step SP8 by the average shift Lavg rises by thepredetermined threshold Ratio0 as shown in FIG. 15, so that the digitalsignal processor 15 proceeds from step SP8 to step SP17 and switches therecovery time constant r to the short time constant rFast as shown inFIG. 16A. Then, the digital signal processor 15 proceeds to step SP10.Conversely, in any case other than the case where the signal level L1cycof the audio data D1 instantaneously increases, the digital signalprocessor 15 obtains a negative result in step SP8 and proceeds fromstep SP8 to step SP9 and sets the recovery time constant r to the longtime constant rSlow as shown in FIG. 16B. Then, the digital signalprocessor 15 proceeds to step Sp10.

Accordingly, the digital signal processor 15 suppresses the signal levelof the audio data D1 by appropriately switching the recovery timeconstant so as to cope with the transition of the signal level of theaudio data D1, thereby appropriately preventing the unnecessarysuppression of the signal level and clearly reproducing the audio dataD1 compared to the related art.

(2) Operation of the First Example of Preferred Embodiment

In the IC recorder 11 (FIG. 2) according to the first preferredembodiment having the above-mentioned construction, the audio signal S1acquired by the microphone 12 is converted into the audio data D1 by theanalog digital conversion circuit 14, and the audio data D1 is subjectedto data compression by the processing of the digital signal processor 15and the resultant audio data D2 is recorded on the memory 19. The audiodata D2 recorded in this manner is subjected to data expansion by thedigital signal processor 15, and the resultant audio data D1 isconverted into the audio signal S1, which is an analog signal, by thedigital/analog conversion circuit 17 and is outputted from the speaker22.

During reproduction, after the audio data D1 processed in this mannerhas been subjected to data expansion by the digital signal processor 15,the signal level of the audio data D1 is corrected through similarprocessing executed by the AGC circuit 15BC included in the digitalsignal processor 15. Accordingly, in the case of a sound which isrecorded in a large sound volume, the signal level of the sound iscorrected into a low sound volume, and the resultant sound is outputtedfrom the speaker 22. Accordingly, the user can listen to the soundreproduced from the IC recorder 11 without feeling a large difference insound volume between sound from a short distance and sound from a longdistance, whereby the user can use the IC recorder 11 with improved userfriendliness.

In the processing of the audio data D1 by the AGC circuit 15BC in thedigital signal processor 15, the audio data D1 is divided by periods onthe basis of the timing when the signal level crosses zero and rises,and the signal level L1cyc is detected on the basis of a maximumamplitude value in each of the periods (FIGS. 1 and 5). In addition, thegain kx is set (FIG. 5) on the basis of the signal level L1cyc for eachof the periods of the audio data D1 from records on the AGC coefficientconversion table 15C based on the input-output characteristic (FIG. 3)for suppressing large input levels, and the signal level of the audiodata D1 is corrected by the gain kx.

In addition, if the signal level L1cyc which rises in a period becomeslow in the succeeding period, the variable Lrecv associated with theattenuation characteristic specified by the recovery time constant r andthe signal level L1cyc over the succeeding period are compared with eachother on the basis of the signal level L1cyc which rises in the period,and the signal level of the audio data D1 is corrected by the gain kxwhich corresponds to the variable Lrecv associated with the attenuationcharacteristic specified by the recovery time constant r or the signallevel L1cyc over the succeeding period, and the corrected audio signalis outputted. Namely, in this case, if the degree of lowering of thesignal level L1cyc over the succeeding period is small, the signal levelof the audio data D1 is corrected by the gain kx corresponding to thesignal level L1cyc over the succeeding period, whereby the correctedaudio signal is outputted.

Conversely, if the signal level L1cyc over the succeeding period risesto a great degree, the signal level of the audio data D1 is corrected bythe gain kx corresponding to the variable Lrecv associated with theattenuation characteristic specified by the recovery time constant r,and the corrected audio signal is outputted. Accordingly, in the ICrecorder 11, for example, even if the rise of the signal level L1cyc ofthe audio data D1 exceeds the threshold Lth and the signal level Lrecvspecified by the recovery time constant r also exceeds the thresholdLth, the gain is decreased according to the rise of the signal level ofthe input signal, and after that, the gain decreased by the recoverytime constant according to a sharp rise of the signal level of the inputsignal is gradually restored to a gain corresponding to the detectedresult of the signal level.

However, in the case where the gain suppressed in this manner isgradually restored, the gain is temporarily suppressed to an excessivedegree with respect to the signal level L1cyc of the actual audio dataD1, so that the audio data D1 reproduced from the speaker 22 becomeshard of listening to, as the result of the occurrence of breaks in soundand the like. However, if the recovery time constant r is set short inorder to solve this problem, noise like snapping will be perceivedduring appreciation of music and the like.

Accordingly, in this IC recorder 11, the average shift Lavg of thesignal level of the audio data D1 over a predetermined number of periodsincluding the period of a target to be processed is calculated. Inaddition, the signal level L1cyc over the period of the target to beprocessed is divided by the average shift Lavg calculated in thismanner, whereby the degree of the rise of a signal level over the periodof the target to be processed is detected from the resultant divisionvalue.

As to the division value found in this manner, if the signal level L1cycover the period of the target to be processed is larger than the averageshift Lavg, it is possible to determine that the signal level L1cyc issmall in each of the preceding and succeeding periods, but rises to agreat degree in the period of the target to be processed. In this case,it is possible to determine that the signal level L1cyc rises sharply inthe succeeding period. Accordingly, by setting the recovery timeconstant r to a short time constant, it is possible to set a shortrecovery time constant which enables the IC recorder 11 to follow thefall of the signal level after the rise thereof, whereby it is possibleto avoid unnecessary suppression of the signal level.

Conversely, if the signal level L1cyc over the period of the target tobe processed is not much larger than the average shift Lavg, it ispossible to determine that the signal level L1cyc in the period of thetarget to be processed does not rise to a great degree with respect tothe signal level L1cyc in either of the preceding and succeedingperiods. In this case, it is possible to vary the gain according to thetransition of the signal level of the audio data D1 by restoring thegain to a comparatively long recovery time constant without sharplyrestoring the decreased gain.

By switching the recovery time constant r in this manner, it is possibleto switch recovery time constants according to the transition of thesignal level of the audio data D1, whereby it is possible to ameliorateproblems of listening to talk, music or the like compared to the relatedart, by preventing the signal level from being unnecessarily suppressedby a recovery time constant and by suppressing the signal level by arecovery time constant as occasion demands.

In the first preferred embodiment, since the average shift Lavg is foundby approximate arithmetic processing using the weighted addition of theaverage shift Lavg calculated immediately previously and the signallevel detection result, the arithmetic processing can be simplified.

(3) Benefit of the First Example of Preferred Embodiment

According to the above-mentioned configuration, the level of an inputsignal is detected in units of the period of the input signal and therecovery time constant is switched on the basis of a decision as to thesignal level detection result based on the average shift of the inputsignal level, whereby it is possible ameliorate problems of listening totalk, music and the like.

In addition, since the average shift is found by approximate arithmeticprocessing using the weighted addition of the average shift calculatedimmediately previously and the signal level detection result, problemsof listening to conversion, music and the like can be ameliorated bysimple processing.

SECOND EXAMPLE OF PREFERRED EMBODIMENT

The above description of the first preferred embodiment refers to thecase where the signal level of audio data is detected for each period,and an average shift is calculated in units of one period, but thepresent invention is not limited to this case. In other words, sincegain has only to be controlled by detecting the signal level of audiodata without distorting the signal waveform of the audio data, thesignal level of audio data may also be detected in units of a pluralityof periods such as two or more periods, and furthermore, the averageshift may also be calculated in units of this plurality of periods.Otherwise, this processing may also be executed in units of a ½ periodor a ¼ period.

The above description of the first preferred embodiment refers to thecase where the processing of audio data is switched on the basis of twokinds of recovery time constants, but the present invention is notlimited to this case and the processing may also be switched on thebasis of three or more kinds of recovery time constants. In this case,any one of these recovery time constants is selected by making adecision as to a value obtained by dividing the signal level of audiodata by the average value thereof, on the basis of a plurality ofdecision reference values corresponding to the kinds of recovery timeconstants.

The above description of the first preferred embodiment has referred tothe case where the present invention is applied to the processing ofreproducing audio data, but the present invention is not limited to thiscase and can also be widely applied to recording of audio data.

The above description of the first preferred embodiment refers to thecase where the present invention is applied to an IC recorder, but thepresent invention is not limited to this case and can also be widelyapplied to various recording/reproducing devices which record andreproduce audio data on and from various recording media, andfurthermore, to various audio devices which output audio data from lineoutputs. Therefore, though the present invention has been describedherein in its preferred form through examples of preferred embodimentsthereof with a certain degree of particularity, the present inventionshould not be construed as to be limited to such examples of preferredembodiments presented herein, so that various modifications, variations,combinations, sub combinations as well as different applications thereofare possible without departing from the scope and spirit of theinvention.

1. An AGC circuit for varying gain according to a signal level of aninput signal and correcting the signal level of the input signal, theAGC circuit comprising: signal level detector configured to detect thesignal level of the input signal in units of a period of the inputsignal and outputting a result of the signal level detection; and gainvarying circuit configured to variably control the gain for each period,based on the result of signal level detection, each period correspondingto the result of signal level detection; wherein the gain varyingcircuit: gradually restores gain at a recovery time constant to a gaincorresponding to the result of signal level detection in response to adecrease of the signal level of the input signal, after decreasing thegain in response to a rise of the signal level of the input signal; andswitches the recovery time constant based on the result of signal leveldetection, wherein the result of signal level detection is based on anaverage shift value of the signal level of the input signal.
 2. The AGCcircuit according to claim 1, wherein the average shift value comprisesan approximate value calculated by weighting addition based on apreviously calculated average shift value and the result of signal leveldetection.
 3. An AGC circuit gain control method of varying gainaccording to a signal level of an input signal and correcting the signallevel of the input signal, the AGC circuit gain control methodcomprising: detecting step of detecting the signal level of the inputsignal in units of a period of the input signal and outputting a resultof the signal level detection; and gain varying step of variablycontrolling the gain for each period based on the result of signal leveldetection, each period corresponding to the result of signal leveldetection; wherein the gain varying step: gradually restores gain at arecovery time constant to a gain corresponding to the result of signallevel detection in response to a decrease of the signal level of theinput signal, after decreasing the gain in response to a rise of thesignal level of the input signal; and switches the recovery timeconstant based on the result of signal level detection, wherein theresult of signal level detection is based on an average shift value ofthe signal level of the input signal.
 4. The AGC circuit gain controlmethod according to claim 3, wherein the average shift value comprisesan approximate value calculated by weighting addition based on apreviously calculated average shift value and the result of signal leveldetection.
 5. A program for causing a computational means to execute aprocessing sequence of an AGC circuit gain control method of varyinggain according to a signal level of an input signal and correcting thesignal level of the input signal, the AGC circuit gain control methodcomprising: detecting step of detecting the signal level of the inputsignal in units of a period of the input signal and outputting a resultof the signal level detection; and gain varying step of variablycontrolling the gain for each period based on the result of signal leveldetection, each period corresponding to the result of signal leveldetection; wherein the gain varying step: gradually restores gain at arecovery time constant to a gain corresponding to the result of signallevel detection in response to a decrease of the signal level of theinput signal, after decreasing the gain in response to a rise of thesignal level of the input signal; and switches the recovery timeconstant based on the result of signal level detection, wherein theresult of signal level detection is based on an average shift value ofthe signal level of the input signal.